﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace DAO
{
    class Provider
    {
        public string EncodeSHA256(string strPass)
        {
            SHA256CryptoServiceProvider sha256 = new SHA256CryptoServiceProvider();
            byte[] bPass = Encoding.UTF8.GetBytes(strPass);
            bPass = sha256.ComputeHash(bPass);
            StringBuilder strbdPass = new StringBuilder();
            foreach (byte b in bPass)
            {
                strbdPass.Append(b.ToString("x2").ToLower());
            }
            strPass = strbdPass.ToString();
            return strPass;
        }
    }
}
